Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing fsnotify behaviour upon change in files which are volume mounted through secrets #182

Closed

Conversation

abodhekar
Copy link
Contributor

@abodhekar abodhekar commented Sep 22, 2023

issue - https://infoblox.atlassian.net/browse/ATLAS-16938

### Cause of the issue -
when a watch is added on a file, which is volume mounted through secrets, fsnotify emits 1 or more events including REMOVE.
This is due to the underlying behaviour of updation of files upon updation of corresponding secret keys of kubernetes.
the REMOVE event emitted by fsnotify , internally removes a watch on the path/file.
We were additionally removing the watcher, which resulted into "removal of non-existent watcher"

### Solution -

  1. Avoided FATAL, when fsnotify errors "removal of non-existent watcher"
  2. Also sometimes there are more than one event emitted on secret/file change such as REMOVE and CHMOD etc. Upon which pgbouncer could have reloaded similar configuration a few times. Avoided this by caching latest db creds and verify the newer ones are not same as latest used ones.
  3. Due to REMOVE event of file upon change in secret, precautionary checked whether the files are available on the paths before adding a new watcher

@bjeevan-ib bjeevan-ib enabled auto-merge (squash) September 23, 2023 20:03
@abodhekar abodhekar force-pushed the fix/dbproxy-watcher-issue branch from 81b8eae to 7cc0d7b Compare September 25, 2023 05:56
@bjeevan-ib bjeevan-ib closed this Sep 25, 2023
auto-merge was automatically disabled September 25, 2023 17:16

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants